<%@ page language="java" pageEncoding="UTF-8"%>  
<%@ taglib prefix = "c" uri="http://java.sun.com/jsp/jstl/core"%>
<%  
String path = request.getContextPath();  
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";  
%>  
<!DOCTYPE html>  
<html>  
<head>  
<base href="<%=basePath%>">  
</head>  
<body>  
 	<h1>用户列表页面</h1>
 	<h2><a href = "<%=path%>/sysmanage/user/getUserList.do">新增用户</a></h2>
  	<table border="1" cellpadding="10" cellspacing = "0">
  		<tr>
  			<th>用户名</th>
  			<th>登陆名</th>
  			<th>年龄</th>
  			<th>性别</th>
  			<th>操作</th>
  			<th>操作</th>
  		</tr>
  		<c:if test="${userList!=null}">
  			
  			<c:forEach items = "${userList}" var = "user">
  				<tr>
	  				<td>${user.userName}</td>
	  				<td>${user.loginName}</td>
	  				
		  			<td>${user.age}</td>
		  			<td>${user.sex}</td>
		  			<td><a href = "<%=path%>/sysmanage/user/gotoUserEdit.do?userId=${user.userId}">修改</a></td>
		  			<td><a href = "<%=path%>/sysmanage/user/userDel.do?userId=${user.userId}">删除</a></td>
	  			</tr> 			 
  			</c:forEach>
  		</c:if>
  		<c:if test="${userList==null}">
  			<tr><td colspan = "6">没有查询到用户信息</td></tr>
  		</c:if>
  	</table>	
 
 	<h1>批量删除</h1>	
 	<form action = "<%=path%>/batchDelUser.do">
	 	<table border="1" cellpadding="10" cellspacing = "0">
	  		<tr>
	  			<th></th>
	  			<th>姓名</th>
	  			<th>年龄</th>
	  			<th>性别</th>
	  		</tr>
	  		<c:if test="${userList!=null}">
	  			
	  			<c:forEach items = "${userList}" var = "user">
	  				<tr>
	  					<td><input type = "checkbox" name = "userId" value = "${user.userId}"></td>
		  				<td>${user.userName}</td>
			  			<td>${user.age}</td>
			  			<td>${user.sex}</td>
		  			</tr> 			 
	  			</c:forEach>
	  		</c:if>
	  		<c:if test="${userList==null}">
	  			<tr><td colspan = "4">没有查询到用户信息</td></tr>
	  		</c:if>
	  	</table>
	  	<h2><input type = "submit" value = "批量删除"></h2>
 	</form>
 	
 	<h1>批量修改</h1>	
 	<form action = "<%=path%>/sysmanage/user/userUpdateBatch.do">
	 	<table border="1" cellpadding="10" cellspacing = "0">
	  		<tr>	  			 
	  			<th>姓名</th>
	  			<th>年龄</th>
	  			<th>性别</th>
	  		</tr>
	  		<c:if test="${userList!=null}">
	  			
	  			<c:forEach items = "${userList}" var = "user" varStatus="i">
	  				<tr>
	  					<input type = "hidden" name = "userList[${i.index}].userId" value = "${user.userId}">
 		  				<td><input type = "text" name = "userList[${i.index}].userName" value = "${user.userName}"></td>
			  			<td><input type = "text" name = "userList[${i.index}].age" value = "${user.age}"></td>
			  			<td><input type = "text" name = "userList[${i.index}].sex" value = "${user.sex}"></td>
		  			</tr> 			 
	  			</c:forEach>
	  		</c:if>
	  		<c:if test="${userList==null}">
	  			<tr><td colspan = "3">没有查询到用户信息</td></tr>
	  		</c:if>
	  	</table>
	  	<h2><input type = "submit" value = "批量修改"></h2>
 	</form>
 
 </body>   
</html>  